<?php
if ($read_message->num_rows() > 0) {
    $mess = $read_message->row();
    $id = $mess->id;
}
?>
<div id="wrapper-content" style="width: 90%;">
        <div align="left" id="title_view_profile" >Messages</div>
    <table align="center" width="100%" class="list" >
        <thead>
            <tr>
                <th colspan="3"></th>
                
                <th></th>
            </tr>
        </thead>
        <?php
        $image = './doggy_avatar/images/' . $mess->avatar;
        if (file_exists($image)) {
            $image = base_url() . 'doggy_avatar/images/' . $mess->avatar;
        } else {
            $image = root_url('doggy-flirt') . './assets/noimage.gif';
        }

        $long_date = $mess->posted_date;
        $now = time();
        $posted_date = timespan($long_date, $now);
        ?>
        <tr class="highlight">
            <td width="10%" valign="top" colspan="2">
                <a href="<?php echo site_url('home/compte').'/'.$mess->posted_by?>"><img height="60px" border="0" src="<?php echo $image; ?>" width="60" alt=""/></a>
            </td>
            <td>
                <p style="color: blue"><a href="<?php echo site_url('home/compte').'/'.$mess->posted_by?>"><?php echo $mess->display_name; ?></a></p>
                
                <p style="font-weight: bold;"><?php echo $mess->title; ?></p>
                
                <p><?php echo $mess->content; ?></p>
                
                <p style="font-size: x-small;"><?php echo $posted_date; ?></p>
            </td>
            <td width="70px">
                <a class="supprimer" href="#" ><img border="0"src="<?php echo root_url('doggy-flirt') . 'assets/admin/' ?>images/supprimer.png"/></a>
                <div style="display:none">
                    Confirmer <br/>
                    <img border="0"src="<?php echo root_url('doggy-flirt') . 'assets/admin/' ?>images/oui.png"/>
                    <a class="non" href="#" ><img  border="0"src="<?php echo root_url('doggy-flirt') . 'assets/admin/' ?>images/non.png"/></a>
                </div>
            </td>
        </tr>
    </table>
</div>
<?php echo form_open('message/reply_message' . '/' . $mess->id); ?>
<table align="center">
    <tr>
        <td>Sujet:</td>
        <td><input type="text" name="title" size="25" value="RE: <?php echo $mess->title;?>"/></td>
        <td><?php echo form_error('title') ?><td>
    </tr>
    <tr>
        <td>Contenu : </td>
        <td><textarea name="content" id="content" type="text" rows="10" cols="40"></textarea></td>
        <td><?php echo form_error('content') ?></td>
    </tr>
    <tr>
        <td><input type="submit" name="submit" value="Envoyer" /></td>
    </tr>
</table>
<?php echo form_close(); ?>
